
package com.howfun.android.antguide;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

import com.howfun.android.antguide.utils.Utils;

/**
 * 首页
 * 
 * @author Administrator
 */
public class MainPage extends Activity implements OnClickListener {

    private ImageView mStart;

    private ImageView mAbout;

    private ImageView mExit;

    private ImageView mSettings;

    private ImageView mHelp;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.mainpage);
        findViews();

    }

    private void findViews() {
        mStart = (ImageView)findViewById(R.id.mainpage_start);
        mStart.setOnClickListener(this);
        mHelp = (ImageView)findViewById(R.id.mainpage_help);
        mHelp.setOnClickListener(this);
        mExit = (ImageView)findViewById(R.id.mainpage_exit);
        mExit.setOnClickListener(this);
        mSettings = (ImageView)findViewById(R.id.mainpage_settings);
        mSettings.setOnClickListener(this);
        mAbout = (ImageView)findViewById(R.id.mainpage_about);
        mAbout.setOnClickListener(this);

        Utils.setAD(this);

    }

    @SuppressWarnings("unused")
    private void sosceo() {
    }

    @Override
    public void onClick(View arg0) {
        Intent intent = new Intent();
        switch (arg0.getId()) {
            case R.id.mainpage_start:
                // intent.setClass(MainPage.this, HelpPage.class);
                intent.setClass(MainPage.this, LevelActivity.class);
                startActivity(intent);
                break;
            case R.id.mainpage_help: //进入帮助页面
                intent.setClass(MainPage.this, HelpPage.class);
                // intent.setClass(MainPage.this, hf2d.class);
                startActivity(intent);
                break;

            case R.id.mainpage_settings: // 进入设置界面
                intent.setClass(MainPage.this, SettingsActivity.class);
                startActivity(intent);
                break;

            case R.id.mainpage_exit: // 退出程序
                finish();
                break;

            case R.id.mainpage_about: // 关于我们
                Utils.showAbout(this);
                break;
            default:
                break;
        }

    }

}
